<?php
// Test whether cookies are available.

require_once('config.php');

if (!array_key_exists('cookie', $_GET)) {
	// Set a cookie.
	setcookie($larch_pfx . 'cookie', 'cookie_test', time()+60);
	// Reload.
	header("Location: cookietest.php?cookie=test");
} else {
	// Check if cookie exists.
	if (empty($_COOKIE[$larch_pfx . 'cookie'])) {
		header("Location: cookiefail.php");
	} else {
		header("Location: login.php");
	}
}
?>
